import { api } from '../index'

//todo:发送登录请求
export function getUser(username,password){
    return api.post('/loginUser', {
      username: username,
      password: password
    }, {
      headers: {
        'Content-Type': 'application/json'
      }
    })

}

export function registerUser(registerUserData){
    return api.post('/regUser',registerUserData)
}

//更新用户信息
export function updataUser(userData){
    return api.put('/user',userData)
}

//根据id查询用户
export function getUserById(id){
  return api.get(`/user/${id}`,id)
}